<?php
$arr=$_GET;
$res=file_get_contents("3.txt");
$info=json_decode($res,true);
if(empty($res)){
$date[]=$arr;
file_put_contents("3.txt",json_encode($date));
}else{
    array_push($info,$arr);
    file_put_contents("3.txt",json_encode($info));
}
header("Location:");

?>




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="" method="get">
        <input type="text" name="message">
        <input type="submit" value="留言">
        
    </form>
</body>
</html>